package org.ysu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.ysu.common.JsonResult;
import org.ysu.service.RegionService;

@RestController
@RequestMapping("/region")
public class RegionController {
    @Autowired
    RegionService regionService;

    @GetMapping("/get/{rid}")
    public JsonResult getByRid(@PathVariable Integer rid){
        String address=regionService.getByRid(rid);
        JsonResult jsonResult=new JsonResult(1,"success",address);
        return jsonResult;
    }
}
